package com.iplant.pdm.service;

import com.iplant.base.po.excel.ExcelData;
import com.iplant.pdm.service.basicenum.fpc.FPCParamType;
import com.iplant.pdm.service.po.bop.*;
import com.iplant.pdm.service.po.bop.partpoint.FPCRouteStep;
import com.iplant.pdm.service.po.fpc.*;
import com.iplant.base.po.Pagination;
import com.iplant.base.po.ServiceResult;
import com.iplant.basic.service.po.bms.BMSEmployee;
import com.iplant.pdm.service.po.fpc.flow.FPCFlowPart;

import java.util.List;
import java.util.Map;

public interface FPCService {

    //region 老接口
    ServiceResult<List<FPCCapacity>> FPC_CreateCapacityList(BMSEmployee wLoginUser, int wProductID, int wFactoryID,
                                                            int wWorkShopID, int wWorkAreaID, int wStationID);


    // 标准工序


    ServiceResult<Integer> FPC_UpdatePart(BMSEmployee wLoginUser, FPCPart wPart);

    ServiceResult<Integer> FPC_DeletePart(BMSEmployee wLoginUser, FPCPart wPart);

    ServiceResult<Integer> FPC_ActivePart(BMSEmployee wLoginUser, FPCPart wPart, int wActive);

    ServiceResult<FPCPart> FPC_QueryPart(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<List<FPCPart>> FPC_QueryPartList(BMSEmployee wLoginUser, String wName, int wActive,
                                                   Pagination wPagination);

    // 标准工步

    ServiceResult<Integer> FPC_UpdatePartPoint(BMSEmployee wLoginUser, FPCPartPoint wPartPoint);

    ServiceResult<Integer> FPC_DeletePartPoint(BMSEmployee wLoginUser, FPCPartPoint wPartPoint);

    ServiceResult<Integer> FPC_ActivePartPoint(BMSEmployee wLoginUser, FPCPartPoint wPart, int wActive);

    ServiceResult<FPCPartPoint> FPC_QueryPartPoint(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<List<FPCPartPoint>> FPC_QueryPartPointList(BMSEmployee wLoginUser, String wName, int wActive,
                                                             Pagination wPagination);

    // 工艺路径

    ServiceResult<Integer> FPC_UpdateRoute(BMSEmployee wLoginUser, FPCRoute wRoute);

    ServiceResult<FPCRoute> FPC_CopyRoute(BMSEmployee wLoginUser, FPCRoute wRoute);

    ServiceResult<Integer> FPC_DeleteRoute(BMSEmployee wLoginID, FPCRoute wRoute);

    ServiceResult<Integer> FPC_SetRouteToStandard(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> FPC_ActiveRoute(BMSEmployee wLoginUser, FPCRoute wRoute, int wActive);

    ServiceResult<FPCRoute> FPC_QueryRoute(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<List<FPCRoute>> FPC_QueryRouteList(BMSEmployee wLoginUser, String wName, String wCodeLike,
                                                     int wFactoryID, int wLineID, int wCustomerID, int wProductTypeID
            , int wProductID, String wProductNo, int wType,
                                                     int wActive, int wIsStandard, int wHasItem,
                                                     Pagination wPagination);

    ServiceResult<FPCRoute> FPC_QueryRouteStandard(BMSEmployee wLoginUser, int wFactoryID, int wLineID, int wCustomerID,
                                                   int wProductID);

    // 工艺路径--工序段
    ServiceResult<Integer> FPC_UpdateRoutePart(BMSEmployee wLoginUser, FPCRoutePart wRoutePart);

    ServiceResult<Integer> FPC_ActiveRoutePart(BMSEmployee wLoginUser, FPCRoutePart wRoutePart, int wActive);


    ServiceResult<List<FPCRoutePart>> FPC_QueryRoutePartList(BMSEmployee wLoginUser, List<Integer> wRouteID,
                                                             String wName, String wPartCode, String wNameLike,
                                                             int wActive, int wHasItem, Pagination wPagination);

    ServiceResult<Integer> FPC_DeleteRoutePart(BMSEmployee wLoginUser, int wID);

    ServiceResult<FPCRoutePart> FPC_QueryRoutePart(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<List<FPCRoutePart>> FPC_QueryRoutePartList(BMSEmployee wLoginUser, Integer wRouteID, int wActive,
                                                             int wHasItem, Pagination wPagination);

    // 工艺路径--工序

    ServiceResult<Integer> FPC_UpdateRoutePartPoint(BMSEmployee wLoginUser, FPCRoutePartPoint wRoutePartPoint);

    ServiceResult<Integer> FPC_ActiveRoutePartPoint(BMSEmployee wLoginUser, FPCRoutePartPoint wRoutePartPoint,
                                                    int wActive);

    ServiceResult<Integer> FPC_DeleteRoutePartPoint(BMSEmployee wLoginUser, int wID);

    ServiceResult<FPCRoutePartPoint> FPC_QueryRoutePartPoint(BMSEmployee wLoginUser, int wID, String wCode);

    ServiceResult<FPCRoutePartPoint> FPC_QueryRoutePartPoint(BMSEmployee wLoginUser, int wRouteID, String wPartCode,
                                                             String wRoutePartName, String wName,
                                                             String wPartPointCode);


    ServiceResult<List<FPCRoutePartPoint>> FPC_QueryRoutePartPointList(BMSEmployee wLoginUser, int wRouteID,
                                                                       List<Integer> wRoutePartID,
                                                                       String wRoutePartName, String wPartCode,
                                                                       String wName, String wPartPointCode,
                                                                       String wNameLike, int wActive, int wHasItem,
                                                                       Pagination wPagination);

    ServiceResult<List<FPCStepSOP>> FPC_GetSOPList(BMSEmployee wLoginUser, int wRouteID, int wRoutePartID,
                                                   List<Integer> wRoutePartPointID, String wRoutePartName,
                                                   String wPartCode, String wRoutePartPointName,
                                                   String wPartPointCode, String wNameLike, int wActive,
                                                   Pagination wPagination);

    ServiceResult<List<FPCStepSOP>> FPC_GetSOPList(BMSEmployee wLoginUser, int wRouteID, String wRoutePartName,
                                                   String wPartCode, String wRoutePartPointName,
                                                   String wPartPointCode, String wNameLike);

    ServiceResult<List<FPCStepSOP>> FPC_GetSOPList(BMSEmployee wLoginUser, int wRoutePartID, String wRoutePartPointName,
                                                   String wPartPointCode, String wNameLike);

    ServiceResult<List<FPCStepSOP>> FPC_GetSOPList(BMSEmployee wLoginUser, int wRoutePartPointID, String wNameLike);

    ServiceResult<Integer> FPC_UpdateSOP(BMSEmployee wLoginUser, FPCStepSOP wFPCStepSOP);

    ServiceResult<Integer> FPC_ActiveSOP(BMSEmployee wLoginUser, FPCStepSOP wFPCStepSOP, int wActive);

    ServiceResult<Integer> FPC_DeleteSOP(BMSEmployee wLoginUser, FPCStepSOP wFPCStepSOP);

    ServiceResult<List<FPCRouteStation>> FPC_GetRouteStationList(BMSEmployee wLoginUser, int wStationID, String wCode,
                                                                 int wRouteID, int wRoutePartID,
                                                                 List<Integer> wRoutePartPointID,
                                                                 String wRoutePartName, String wPartCode,
                                                                 String wRoutePartPointName, String wPartPointCode,
                                                                 String wNameLike, int wActive, Pagination wPagination);

    ServiceResult<List<FPCRouteStation>> FPC_GetRouteStationList(BMSEmployee wLoginUser, int wRouteID,
                                                                 String wRoutePartName, String wPartCode,
                                                                 String wRoutePartPointName, String wPartPointCode,
                                                                 String wNameLike);

    ServiceResult<List<FPCRouteStation>> FPC_GetRouteStationList(BMSEmployee wLoginUser, int wRoutePartID,
                                                                 String wRoutePartPointName, String wPartPointCode,
                                                                 String wNameLike);

    ServiceResult<List<FPCRouteStation>> FPC_GetRouteStationList(BMSEmployee wLoginUser, int wRoutePartPointID,
                                                                 String wNameLike);

    ServiceResult<Integer> FPC_UpdateRouteStation(BMSEmployee wLoginUser, FPCRouteStation wFPCRouteStation);

    ServiceResult<Integer> FPC_ActiveRouteStation(BMSEmployee wLoginUser, FPCRouteStation wFPCRouteStation,
                                                  int wActive);

    ServiceResult<Integer> FPC_DeleteRouteStation(BMSEmployee wLoginUser, FPCRouteStation wFPCRouteStation);

    ServiceResult<FPCRouteStation> FPC_QueryRouteStation(BMSEmployee wLoginUser, int wID);

    ServiceResult<Integer> FPC_RouteSetCurrent(BMSEmployee wBMSEmployee, FPCRoute wRoute, int wIsStandard);
    //endregion

    //region 工步
    ServiceResult<FPCRouteStep> FPC_RouteStepInfo(BMSEmployee wLoginUser, Map<String, Object> wParams);

    ServiceResult<List<FPCRoute>> FPC_QueryRouteAll(BMSEmployee wLoginUser, Map<String, Object> wParams,
                                                    Pagination wPagination);
    //endregion

    ServiceResult<List<FPCRoutePartPoint>> FPC_QueryProductRoutePartPoint(BMSEmployee wLoginUser, int wFactoryID, int wLineID, int wCustomerID,
                                                                          int wProductID,
                                                                          Pagination wPagination);

    //region 工艺流程图
    ServiceResult<List<FPCFlowPart>> FPC_QueryFlowDataPart(BMSEmployee wLoginUser, int wRouteID, int wRoutePartID);
    //endregion

    //region 工艺结构
    ServiceResult<Integer> FPC_RoutePartPointActive(BMSEmployee wLoginUser, int wActive,
                                                    List<FPCRoutePartPoint> wFPCRoutePartPointList);

    ServiceResult<Integer> FPC_RoutePartActive(BMSEmployee wLoginUser, int wActive,
                                               List<FPCRoutePart> wFPCRoutePartList);

    ServiceResult<Integer> FPC_RouteActive(BMSEmployee wLoginUser, int wActive, List<FPCRoute> wFPCRouteList);

    ServiceResult<Integer> FPC_RouteParentActive(BMSEmployee wLoginUser, int wActive,
                                                 List<FPCRouteParent> wFPCRouteParentList);

    ServiceResult<Integer> FPC_ImportRoute(BMSEmployee wLoginUser, ExcelData wExcelData);

    ServiceResult<String> FPC_ExportRoute(BMSEmployee wLoginUser, int wRouteID);
    //endregion

    //region 工艺路线审批

    ServiceResult<Integer> FPC_RouteCopy(BMSEmployee wLoginUser, int wRouteID, String wNewVersion, int wIsCopyParameters, int wBOPParentID, int wActive);

    //endregion

    //region 产品信息
    ServiceResult<Integer> FPC_ImportProduct(BMSEmployee wLoginUser, ExcelData result);
    //endregion

    //region 产品参数
    ServiceResult<Integer> FPC_ProductParameterImport(BMSEmployee wLoginUser, ExcelData wExcelData, int routeID,
                                                      int paramType);

    ServiceResult<List<FPCProductParameter>> FPC_QueryToAddList(BMSEmployee wLoginUser, int wRoutePartPointID, FPCParamType wFPCParamType, int wRoutePartPointParamID);

    ServiceResult<Integer> FPC_CleanUpDirtyData(BMSEmployee wLoginUser);
    //endregion
}
